﻿@model QDT.Core.Members.User
@{
    ViewBag.Title = "好友互动";
}
<script type="text/javascript" src="@Url.Content("~/Content/Default/JS/jquery.validate.js")"> </script>
<script type="text/javascript" src="@Url.Content("~/Content/Default/JS/messages_zh.js")"> </script>
<script type="text/javascript">
    $().ready(function () {
        $('form').validate({
            rules: {
                Email: {
                    required: true
                }
            },
            messages: {
                Email: {
                    required: "<i class='ui-tiptext-icon iconfont' id='iusername-error'  title='出错'>&#xf0155;</i><span  style='color:Red;'>请输入邮箱！</span>"
                }
            },
            errorPlacement: function (error, element) {
                if (element.is("#Email")) {
                    error.appendTo('#email-error');
                }
            }
        });
        $("#Friend_play").css("background", "#e0524b");
        $("#Friend_play i,#Friend_play span").css("color", "white");
        $("#Friend_play .san-jiaoxing").css("display", "block");
    });
</script>
<style type="text/css">
    .ui-body
    {
        padding: 0;
        background-color: white;
    }
    .ui-grid-20
    {
        width: 778px;
        margin-left: -20px;
    }
</style>

@Html.Action("_UserBanner")
<div class="ui-body">
    <div class="ui-inner">
        <div class="ui-grid-row">
            @Html.Action("UserMenu", new { route = MenuRoute.FriendsInteract })
            <div class="ui-grid-20">
                <div class="ui-box">
                    <div class="ui-box-hd">
                        <h1 class="ui-box-title">
                            好友互动
                        </h1>
                    </div>
                    <div class="ui-tipbox ui-tipbox-wait">
                        <div class="ui-tipbox-content">
                            <p class="ui-tipbox-explain" style="color: #fff;">
                                推荐必有礼，5元红包+10000体验金随你领！
                            </p>
                        </div>
                    </div>

                    <fieldset>
                        <br/>
                        <div class="ui-form-item">
                            <label for="" class="ui-label">
                                您的专属推荐链接：
                            </label>
                            <input id="copyText" type="text" class="ui-input ui-input-large" value="http://www.zxidai.com/Account/Register?pid=@QDTContext.Current.User.ID" style="width:360px;" />
                        </div>
                        <div class="ui-form-item">
                            <a href="javascript:;" class="ui-button ui-button-orange big" onclick="javascript:copy_code($('#copyText').val());">复制链接</a>
                        </div>
                    </fieldset>

                </div>
            </div>
        </div>
    </div>
</div>
<div style="margin-top: -10px;">@Html.Partial("_BindBottomImage")</div>

<script type="text/javascript">
    function copy_code(copyText) {
        if (window.clipboardData) {
            window.clipboardData.setData("Text", copyText);
        } else {
            var flashcopier = "flashcopier";

            if (!document.getElementById(flashcopier)) {
                var divholder = document.createElement('div');
                divholder.id = flashcopier;
                document.body.appendChild(divholder);
            }
            document.getElementById(flashcopier).innerHTML = '';
            var divinfo = '<embed src="/Content/_clipboard.swf" FlashVars="clipboard=' + encodeURIComponent(copyText) + '" width="0" height="0" type="application/x-shockwave-flash"></embed>';
            document.getElementById(flashcopier).innerHTML = divinfo;
        }
        alert('复制成功！');
    }
</script>
